export default [
  {
    path: "/pos/pdm",
    redirect: "/pos/category",
    meta: {
      icon: "ep:menu",
      title: "商品管理",
      roles: ["admin", "manager"],
      rank: 2
    },
    children: [
      {
        path: "/pos/category",
        name: "category",
        component: () => import("@/views/pos/category/index.vue"),
        meta: {
          icon: "ep:folder",
          roles: ["admin", "manager"],
          title: "商品类别"
        }
      },
      {
        path: "/pos/product",
        name: "product",
        component: () => import("@/views/pos/product/index.vue"),
        meta: {
          icon: "ep:files",
          roles: ["admin", "manager"],
          title: "商品列表"
        }
      },
      {
        path: "/pos/specification",
        name: "specification",
        component: () => import("@/views/pos/specification/index.vue"),
        meta: {
          icon: "ep:files",
          roles: ["admin", "manager"],
          title: "规格模板库"
        }
      }
    ]
  },
  {
    path: "/pos/som",
    redirect: "/pos/sale",
    meta: {
      icon: "ep:shop",
      title: "销售管理",
      roles: ["admin", "manager"],
      rank: 1
    },
    children: [
      {
        path: "/pos/sale",
        name: "sale",
        component: () => import("@/views/pos/sale/index.vue"),
        meta: {
          icon: "ep:shopping-cart-full",
          roles: ["admin", "manager"],
          title: "订单收银"
        }
      },
      {
        path: "/pos/payment",
        name: "payment",
        component: () => import("@/views/pos/payment/index.vue"),
        meta: {
          icon: "ep:money",
          roles: ["admin", "manager"],
          title: "订单列表"
        }
      },
      {
        path: "/pos/payment",
        name: "payment",
        component: () => import("@/views/pos/payment/index.vue"),
        meta: {
          icon: "ep:money",
          roles: ["admin", "manager"],
          title: "退货/换货"
        }
      }
    ]
  },
  {
    path: "/pos/int",
    redirect: "/pos/inventory",
    meta: {
      icon: "ep:inventory",
      title: "库存管理",
      roles: ["admin", "manager"],
      rank: 3
    },
    children: [
      {
        path: "/pos/inventory",
        name: "inventory",
        component: () => import("@/views/pos/inventory/index.vue"),
        meta: {
          icon: "ep:shopping-cart-full",
          roles: ["admin", "manager"],
          title: "库存管理"
        }
      }
    ]
  },
  {
    path: "/pos/mak",
    redirect: "/pos/marketing",
    meta: {
      icon: "ep:money",
      title: "营销活动",
      roles: ["admin", "manager"],
      rank: 4
    },
    children: [
      {
        path: "/pos/marketing",
        name: "marketing",
        component: () => import("@/views/pos/marketing/index.vue"),
        meta: {
          icon: "ep:money",
          roles: ["admin", "manager"],
          showParent: true,
          title: "促销规则"
        }
      }
    ]
  },
  {
    path: "/pos/report",
    redirect: "/pos/saleroom",
    meta: {
      icon: "ep:shop",
      title: "报表分析",
      roles: ["admin", "manager"],
      rank: 5
    },
    children: [
      {
        path: "/pos/saleroom",
        name: "saleroom",
        component: () => import("@/views/pos/saleroom/index.vue"),
        meta: {
          icon: "ep:shopping-cart-full",
          roles: ["admin", "manager"],
          title: "销售统计"
        }
      },
      {
        path: "/pos/categoryAnalysis",
        name: "categoryAnalysis",
        component: () => import("@/views/pos/categoryAnalysis/index.vue"),
        meta: {
          icon: "ep:folder",
          roles: ["admin", "manager"],
          title: "类别分析"
        }
      }
    ]
  },
  {
    path: "/pos/sym",
    redirect: "/pos/system",
    meta: {
      icon: "ri:settings-3-line",
      title: "系统设置",
      roles: ["admin"], // 子路由可单独配置
      rank: 6
    },
    children: [
      {
        path: "/pos/system",
        name: "system",
        component: () => import("@/views/pos/system/index.vue"),
        meta: {
          icon: "ri:settings-3-line",
          roles: ["admin"],
          showParent: true,
          title: "角色权限"
        }
      }
    ]
  }
] satisfies Array<RouteConfigsTable>;
